{include file="index@public/header" /}
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/swiper.min.css"/>
<style>
    .selfDetail{
        position: absolute;
        top: 3em;
        width: 96%;
        margin: 5% 2%;
        overflow: auto;
        height: 610px;
        overflow-x: hidden;
    }
    .selfDetail img{
        height:100%;
        max-width:100%;
    }
    .selfDetail .detail span{
        padding:0em 1em;
    }
    .selfDetail .detail{
        margin: 2em;
        margin-left: 4.1em;
    }
    .selfDetail .detail div{
        padding:.5em ;
        border-bottom:1px dashed #ddd;
    }
    .selfDetail .caozuo{
        position: absolute;
        bottom:5em;
        width:100%;
    }
    .selfDetail .zhezhao{
        background: #000;
        opacity: .75;
        position: fixed;
        top:0;
    }
    .selfDetail .liwu{
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 11;
        height: 100%;
        padding:6em 1em;
        overflow-y:scroll
    }
    .selfDetail .liwu .list{
        border-bottom:1px dashed #eee;
        height:80%;
    }
    .selfDetail .liwu span{
        height:5em;
        margin:2em 0;
    }
    .selfDetail .liwu p{
        text-align: center;
        color:#eee;
        margin-top:.5em;
    }
    .selfDetail .queding{
        padding:1em;
    }
    .selfDetail .fasong{
        height:5em;
    }
    .selfDetail .baise{
        color:#fff;
        border:1px solid #fff;
        border-radius: .5em;
        line-height:2em;
    }
</style>
<div class = "selfDetail"  ng-controller = "liwuCtrl">
    <div class="swiper-container">
        <div class="swiper-wrapper">
            <div class="swiper-slide"><img src="{$list['shpic01']}" onerror="javascript:this.src='__PUBLIC__/images/login-img.jpg'"/></div>
            <div class="swiper-slide"><img src="{$list['shpic02']}" onerror="javascript:this.src='__PUBLIC__/images/login-img.jpg'"/></div>
            <div class="swiper-slide"><img src="{$list['shpic03']}" onerror="javascript:this.src='__PUBLIC__/images/login-img.jpg'"/></div>
        </div>
        <!-- Add Pagination -->
        <div class="swiper-pagination"></div>
    </div>
    <div class = "detail row">
        <div class = "col-xs-6">用户名<span>{$list['username']}</span></div>
        <div class = "col-xs-6">YY号<span id = "uid">{$list['uid']}</span></div>
        <div class = "col-xs-6">年龄<span>{$list['birthday']}</span></div>
        <div class = "col-xs-6" name = "sex">性别</div>
        <div class = "col-xs-6" name = "xueli">学历</div>
        <div class = "col-xs-6">身高<span>{$list['shengao']}</span></div>
        <div class = "col-xs-6">籍贯<span>{$list['jiguan']}</span></div>
        <div class = "col-xs-6">职业<span>{$list['zhiye']}</span></div>
        <div class = "col-xs-12">签名<p>{$list['dubai']}</p></div>
    </div>
    <div class = "caozuo row"><a class = "btn btn-default col-xs-4 col-xs-offset-2" href = "{:url('index/oneself/xiexin',array('id'=>$list['uid']))}">写信</a><a class = "btn btn-default col-xs-4 col-xs-offset-1" ng-click = "xinshi = !xinshi">送礼物</a></div>
    <div class = "zhezhao" ng-show = "xinshi"></div>
    <div class = "row liwu" ng-show = "xinshi">
        <div class = "list">
            <span class = "col-xs-3" ng-repeat = "list in lists"><img src = "{{list.source}}" ng-click = "huoqu(list)"/><p>{{list.score}}积分</p></span>
        </div>
        <div class = "queding row" ng-repeat = "data in datas">
            <div class = "col-xs-3 fasong"><img src = "{{data.source}}"/></div>
            <div class = "col-xs-9 pull-right" style = "top:2em;">
                <div class = "col-xs-2 baise" ng-click = "data.num  = data.num > 1? data.num-1:1">-</div>
                <div class = "col-xs-6"><input value = "{{data.num}}" class = "form-control" style = "width:100%"/></div>
                <div class = "col-xs-2 baise" ng-click = "data.num = data.num+1">+</div>
                <div class = "col-xs-2 baise" style = "border:none" ng-click = "datas.splice(index,1)"><i class="fa fa-trash-o"></i></div>
            </div>
        </div>
        <div class = "pull-right" style = "margin-top:1em;"><button class = "btn btn-default" ng-click = "queding()">点击赠送</button></div>
    </div>
</div>
<script src="__PUBLIC__/js/swiper.min.js"></script>
<script src="__PUBLIC__/js/peizhi.js"></script>
<script type="text/javascript">
    /*$(function(){*/
        /*轮播*/
        var swiper = new Swiper('.swiper-container', {pagination: {el: '.swiper-pagination'}}),list = JSON.parse('{$list}'),shuju = ['sex','xueli'];
        /*读取配置信息*/
        for(var i = 0;i<shuju.length;i++){
            for(var m = 0;m<peizhi.length;m++){
                if(shuju[i] == peizhi[m].item){
                    for(var n = 0;n<peizhi[m].child.length;n++){
                        if(list[shuju[i]] == peizhi[m].child[n].id){
                            $("div[name="+shuju[i]+"]").append("<span>"+peizhi[m].child[n].name+"</span>");
                        }
                    }
                }
            }
        }
        app.controller('liwuCtrl', function($scope){
            $scope.xinshi = false;
            $scope.score = 0;
            $scope.lists = [{name:'yumao',score:3,num:1,source:'__PUBLIC__/images/login-img.jpg'},{name:'meigui',score:2,num:1,source:'__PUBLIC__/images/login-img.jpg'},{name:'bbtang',score:1,num:1,source:'__PUBLIC__/images/login-img.jpg'},{name:'memeda',score:5,num:1,source:'__PUBLIC__/images/login-img.jpg'},{name:'latiao',score:1,num:1,source:'__PUBLIC__/images/login-img.jpg'},
                {name:'xiong',score:3,num:1,source:'__PUBLIC__/images/login-img.jpg'},{name:'520',score:3,num:1,source:'__PUBLIC__/images/login-img.jpg'},{name:'1314',score:5,num:1,source:'__PUBLIC__/images/login-img.jpg'},{name:'xiexie',score:2,num:1,source:'__PUBLIC__/images/login-img.jpg'},{name:'zhuantou',score:2,num:1,source:'__PUBLIC__/images/login-img.jpg'},{name:'jidan',score:3,num:1,source:'__PUBLIC__/images/login-img.jpg'}];
            $scope.datas = [];
            $scope.huoqu = function(data){
                $scope.datas.push(data);
            }
            $scope.queding = function(){
                $.ajax({type: "post",url: '/index/index/liwu', data: {'data':$scope.datas,'jieshou':$('#uid').html()}, cache:false, dataType: 'json',
                    success: function (data){
                        $.messager.show(data.msg, {placement: 'center',type:'success'});
                        window.location.reload();
                    }
                });
            }
        });

   /* })*/
</script>
{include file="index@public/selfFooter" /}